# -*- coding = utf-8 -*-
# @Time    : 2025/3/31 下午8:30
# @Author  : yqk
# @File    : 防止检测2.py
# @Software: PyCharm

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service  # 新增 Service 类
# 使用 Service 指定 chromedriver 路径
service = Service(r'D:\python-code\chromedriver-win64\chromedriver.exe')
opt = Options()
opt.debugger_address = "127.0.0.1:8888"

# 初始化 WebDriver
driver = webdriver.Chrome(service=service, options=opt)

url = 'https://www.baidu.com'
driver.get(url)



